#ifndef HEAD_H
#define HEAD_H
#define MMAP_THRESHOLD (100 * 1024 * 1024)
#include <my_header.h>
#include <sys/mman.h>
int recvn(int sockfd, void *buf, int length){
    int total = 0;
    char *p = (char *)buf;
    while(total < length){
        ssize_t sret = recv(sockfd,p+total,length-total,0);
        total += sret;
    }
    return total;
}
typedef struct train_s{
    int length;
    char data[4096];
}train_t;
typedef struct client_s{
    int fd;
    char userName[1024];
    char pwd[1024];
    //todo
}client_t;
#endif
